/*
	       File: frmSelectFileTypes.cs
	Create Date: 2007-08-17
	    Version:

	Description:


	 Change log:


*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using GuerillaProgrammer.FileProcessor.Settings;

namespace GuerillaProgrammer.FileProcessor
{
    public partial class frmSelectFileType : Form
    {
        #region Private member fields
        private Configuration _Configuration;
        #endregion

        #region Constructors and cleanup methods
        public frmSelectFileType()
        {
            InitializeComponent();
        }
        #endregion

        #region Private implementation methods
        #endregion

        #region Class properties
        public ConfigurationFileType FileType
        {
            get { return (ConfigurationFileType)lstFileTypes.SelectedItem; }
        }
        #endregion

        #region Events handlers
        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }
        private void btnOK_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
        #endregion

        #region Public interface
        public void LoadFileTypes(Configuration configuration)
        {
            _Configuration = configuration;
            lstFileTypes.DataSource = _Configuration.FileTypes;
            lstFileTypes.DisplayMember = "Name";
        }
        #endregion
    }
}